
			function checkForm() {
				
				var uname=document.forms["register"]["username"].value;
				var pass=document.forms["register"]["password"].value; 
				var rpass=document.forms["register"]["rpass"].value;
				var email=document.forms["register"]["email"].value;
				var atPos=email.indexOf("@");
				var dotPos=email.indexOf(".");
				var error;
				
				if (uname=="")
				{
					document.getElementById("uerror").innerHTML="* ERROR: Username is required";
					error=true;
				}
				else if (uname.length<8) {
					document.getElementById("uerror").innerHTML="* ERROR: Username must have at least 6 characters.";
					error=true;
				}
				else document.getElementById("uerror").innerHTML="*";
				
				if (pass=="")
				{
					document.getElementById("perror").innerHTML="* ERROR: Password is required.";
					error=true;
				}			
				else if (pass!=""&&rpass!=""&&pass!=rpass) {
					document.getElementById("perror").innerHTML="* ERROR: Passwords do not match.";
					error=true;
				}
				else document.getElementById("perror").innerHTML="*";
				
				if (rpass=="")
				{
					document.getElementById("rperror").innerHTML="* ERROR: Please confirm your password.";
					error=true;
				}
				else document.getElementById("rperror").innerHTML="*";

				
				if(email=="") 
				{
					document.getElementById("mailerror").innerHTML="* ERROR: Please enter your email.";
					error=true;
				}
				else if (atPos<1 || dotpos<atPos+2 || dotpos+2>=x.length) {
					document.getElementById("mailerror").innerHTML="* ERROR: Invalid email";
					error=true;
				}
				else document.getElementById("mailerror").innerHTML="*";
	
				if (error)
						return false;
				else return true;
											
			}